package com.wx.spring.boot.dubbo.impl;


import com.wx.boot.dubbo.api.service.UserService;
import com.wx.boot.dubbo.api.vo.UserVO;
import org.apache.dubbo.config.annotation.Method;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.stereotype.Component;



import java.util.ArrayList;
import java.util.List;


/**
 * @ClassName UserServiceImpl
 * @Author wx
 * @Description 用户业务实现
 * @Date 2019-04-13-15:56
 */
@Service //暴露服务
@Component
public class UserServiceImpl implements UserService{

    @Override
    public List<UserVO> getUserAllList() {
        System.out.println("服务提供方重试");
        List<UserVO> userVOList = new ArrayList<>();
        userVOList.add(new UserVO("张三",26,"男"));
        userVOList.add(new UserVO("李四",24,"男"));
        userVOList.add(new UserVO("小红",18,"女"));
        try {
            Thread.sleep(4000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return userVOList;
    }

    @Override
    public List<UserVO> getUserTest() {
        return getUserAllList();
    }
}
